package czxy.dao;

import czxy.domain.Order;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface OrderMapper {

    //根据 用户的 id 在订单表中 查询  符合条件的订单


    @Select("select * from `order`  where  user_id = #{uid}")
    public List<Order> findOrdersById(@Param("uid") Integer uid);


    //根据oid查询 订单信息

    @Select("select  * from `order`  where oid = #{oid} ")

    @Results({
            @Result(property = "userId", column = "user_id"),
            @Result(property = "user",
                    one = @One(select = "czxy.dao.UserMapper.findUserByUid"),
                    column = "user_id")

    })
    public Order findOrderByOid(@Param("oid") Integer oid);






}






